﻿<UserControl x:Class="TfsBranchLib2.View.BranchSetComboBox"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:View="clr-namespace:TfsBranchLib2.View" mc:Ignorable="d"
             d:DesignHeight="40" d:DesignWidth="373">
    <Grid>
        <ComboBox Name="branchSetComboBox">
            <ComboBox.Resources>
                <View:BranchSetComboBoxWidthConverter x:Key="Converter" />
                <View:BranchSetObjectConverter x:Key="ObjectConverter" />
            </ComboBox.Resources>
            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <View:BranchSetPrecedentControl
                        BranchSetItemValue="{Binding Converter={StaticResource ObjectConverter}}"
                        Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=ComboBox, AncestorLevel=1}, Path=ActualWidth, Converter={StaticResource Converter}}" />
                </DataTemplate>
            </ComboBox.ItemTemplate>
        </ComboBox>
    </Grid>
</UserControl>